package com.aiwiown.snackmq.common.protocol;

/**
 * Defines the types of operations that can be applied to the Raft state machine.
 */
public enum OperationType {
    /**
     * A produce message operation.
     */
    PRODUCE,
    /**
     * This type is for all metadata changes, handled by the Metadata State Machine.
     */
    METADATA,
    /**
     * A consumer offset commit operation.
     */
    COMMIT_OFFSET,
    /**
     * A consumer offset fetch operation.
     */
    FETCH_OFFSET,

    // --- 【新增】事务操作类型 ---
    /**
     * 准备一个事务（写入半消息日志）
     */
    PREPARE_TRANSACTION,
    /**
     * 提交一个事务（将半消息转为普通消息）
     */
    COMMIT_TRANSACTION,
    /**
     * 回滚一个事务
     */
    ROLLBACK_TRANSACTION,
    // --- 【新增结束】 ---

    CLEAN_TOPIC_DATA,
}